#include <iostream>
#include <ctime>
#include "SparseGraph.h"
#include "DenseGraph.h"
using namespace std;
int main() {

    int N = 20;
    int M = 100;

    srand(time(NULL));

    SparseGraph g1(N, false);
//    for (int i = 0; i < M; i++) {
//        int a = rand() % N;
//        int b = rand() % N;
//
//        g1.addEdge(a, b);
//    }
    while(g1.E()<M){
        int a = rand() % N;
        int b = rand() % N;

        g1.addEdge(a, b);
    }
    cout<<"E1 : "<<g1.E()<<endl;
    vector<vector<int>> v1=g1.getG();
    for (int v = 0; v < N; v++) {
        cout << v << " : ";
        for (int w = 0; w < v1[v].size();w++)
            cout<<v1[v][w]<<" ";
        cout<<endl;
    }
    cout<<endl;

    DenseGraph g2(N, false);

//    for (int j = 0; j < M; j++) {
//        int a=rand()%N;
//        int b=rand()%N;
//
//        g2.addEdge(a,b);
//    }
    while(g2.E()<M){
        int a = rand() % N;
        int b = rand() % N;

        g2.addEdge(a, b);
    }
    cout<<"E2 : "<<g2.E()<<endl;
    vector<vector<bool>> v2=g2.getG();
    for (int v = 0; v < N; v++) {
        cout << v << " : ";
        for (int w = 0; w < N; w++)
            if(v2[v][w])
                cout<<w<<" ";
        cout<<endl;
    }
    return 0;

}